<?php
/*
Engineer:  Alex Arey
Updated: 12/3/2011
Description: Displays searched internships by year or term.
*/
 ?>

<div style = "display: inline;">

<h5>Search internship requests</h5>
<?php
$this->form->setAction($this->url());
echo $this->form;
?>
</div>
<h3>Current Internship Positions:</h3>
<table>
    <tr>
    	<th>Position</th>
        <th>Organization</th>
        <th>Term</th>
        <th>Positions</th>
    </tr>
    <?php if($this->positions):?>
    <?php $orgs = $this->organizationnames; ?>
    <?php foreach($this->positions as $pos): ?>
    <tr>
        <td align="center"><a href="
		<?php echo $this->url(array('controller'=>'common','action'=>'viewinternshipdetails','posid'=>$pos['POSID'])); ?>
		"><?php echo $pos['NAME'] ?></a></td>
		<td align="center">
			<a href="<?php echo $this->url(array('controller'=>'common','action'=>'vieworganizationdetails','orgid'=>$pos['CPID']))?>"><? echo $orgs[$pos['CPID']]?></a></td>
		<td align="center"><?php echo $pos['TERM'] ?></td>
        <td align="center"><?php echo $pos['POSITIONSGRANTED'] ?></td> 	
    </tr>
    <?php endforeach ?>
	<?php endif; ?>
<?php if(!$this->positions):?>
	<tr></tr>
	<tr>
		<td colspan = "4" align = "center">No internships found matching your search.</td>
	</tr>
<?php endif; ?>
</table>

